package vic.extension;

import vic.constdefinition.Config;
import vic.controller.GameRoomController;

import com.smartfoxserver.v2.core.SFSEventType;
import com.smartfoxserver.v2.entities.User;
import com.smartfoxserver.v2.entities.data.ISFSObject;
import com.smartfoxserver.v2.entities.data.SFSObject;
import com.smartfoxserver.v2.extensions.ISFSExtension;
import com.smartfoxserver.v2.extensions.SFSExtension;

public class VicExtension extends SFSExtension implements ISFSExtension{	
	public GameRoomController gameController;
	@Override
	public void init(){
		gameController = new GameRoomController();
		gameController.setExtension(this);
		//addEventHandler(SFSEventType.USER_DISCONNECT, UserDisconectHandler.class);
	}
	@Override
	public void handleClientRequest(String command, User sender, ISFSObject params) {
		gameController.handleClientRequest(command,sender,params);
		/*
		// Get the client parameters
        int n1 = params.getInt("n1");
        int n2 = params.getInt("n2");
         
        // Create a response object
        ISFSObject resObj = SFSObject.newInstance(); 
        resObj.putInt("sum", n1 + n2);
         
        // Send it back
        send("add", resObj, sender);
        */
	}
	@Override
	public void destroy(){
	    super.destroy();
	}
}
